package com.wzcl.app.dao.repository;

import com.wzcl.app.dao.model.Subject;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface SubjectRepository extends JpaRepository<Subject,Integer>, JpaSpecificationExecutor<Subject> {
    //通过id查找学科
    @Query(value = "select s.name from Subject s where s.id = ?1")
    String findNameById(Integer id);
}
